<template>
  <j-modal
    :width="width"
    :visible="visible"
    v-if="visible"
    :maskClosable="false"
    :keyboard="false"
    :forceRender="true"
    @cancel="handleCancel"
    wrapClassName="ant-modal-cust-warp"
    class="financial-detail_v2023"
    style="top:5%;height: 100%;overflow-y: hidden">
    <template slot="footer">
      <!--此处为解决缓存问题-->
      <a-button v-if="financialType === '直发预付款' || financialType === '直发预付' || financialType === '预付款单'" v-print="'#advanceOutPrint'" ghost type="primary">{{$t('reportQuery.print')}}</a-button>
     
      <a-button v-if="financialType === '转账'" v-print="'#giroPrint'" ghost type="primary">{{$t('reportQuery.print')}}</a-button>
      <a-button v-if="financialType === '收入'" v-print="'#itemInPrint'" ghost type="primary">{{$t('reportQuery.print')}}</a-button>
      <a-button v-if="financialType === $t('financialManagement.expenditure')" v-print="'#itemOutPrint'" ghost type="primary">{{$t('reportQuery.print')}}</a-button>
      <a-button v-if="financialType === '收款' || financialType === '收款'" v-print="'#moneyInPrint'" ghost type="primary">{{$t('reportQuery.print')}}</a-button>
      <a-button v-if="financialType === '付款'" v-print="'#moneyOutPrint'" ghost type="primary">{{$t('reportQuery.print')}}</a-button>
      <a-button v-if="financialType === '运费单' || financialType === '运费' || financialType === '直发运费单' || financialType === '直发运费'" v-print="'#freightBillPrint'" ghost type="primary">{{$t('reportQuery.print')}}</a-button>
      <a-button v-if="financialType === '运输付款'" v-print="'#freightPaymentPrint'" ghost type="primary">{{$t('reportQuery.print')}}</a-button>
      <a-button v-if="financialType === '预收款单' || financialType === '直发预收款'" v-print="'#advanceInPrint'" ghost type="primary">{{$t('reportQuery.print')}}</a-button>
      <a-button v-if="financialType === '直发收款' || financialType === '直发收款'" v-print="'#FactoryMoneyIn'" ghost type="primary">{{$t('reportQuery.print')}}</a-button>
      <a-button v-if="financialType === '支票核销'" v-print="'#checkVerification'" ghost type="primary">{{$t('reportQuery.print')}}</a-button>
      <a-button v-if="financialType === '预收款'" v-print="'#directAdvanceInPrint'" ghost type="primary">{{$t('reportQuery.print')}}</a-button>
      <a-button v-if="financialType === '预付款'" v-print="'#directAdvanceOutPrint'" ghost type="primary">{{$t('reportQuery.print')}}</a-button>
      <a-button v-if="financialType === '每日对账'" v-print="'#daily_reconciliation'" ghost type="primary">{{$t('reportQuery.print')}}</a-button>
      <a-button v-if="financialType === '返利收款'" v-print="'#rebateReceivePrint'" ghost type="primary">{{$t('reportQuery.print')}}</a-button>
      
      <a-button key="back" @click="handleCancel">{{$t('inPrint.cancel')}}</a-button>
    </template>
    <a-form :form="form">
      <!-- 支票核销 -->
      <template v-if="financialType === '支票核销'">
        <section ref="print" id="checkVerification">
          <a-row class="form-row" :gutter="24">
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.payingMember')">
                <a-input v-decorator="['id']" hidden/>
                {{model.organName}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.operator')">
                {{model.userName}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.documentDate')">
                {{model.billTimeStr}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.documentNo')">
                {{model.billNo}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('manuManagement.state')">
                <span v-if="model.status == '0'" color="red">{{ $t('manuManagement.notApproved') }}</span>
                <span v-if="model.status == '1'" color="green">{{ $t('manuManagement.reviewed') }}</span>
                <span v-if="model.status == '4'" color="orange">{{ $t('manuManagement.notQuotation') }}</span>
              </a-form-item>
            </a-col>
          </a-row>
          <a-table
            ref="table"
            size="middle"
            bordered
            rowKey="id"
            :pagination="false"
            v-getColumnsName="'checkVerificationColumns'"
            :columns="checkVerificationColumns"
            :dataSource="dataSource">
          </a-table>
          <a-row v-if="model.remark" class="form-row" :gutter="24">
            <a-col :lg="24" :md="24" :sm="24">
              <a-form-item :labelCol="labelCol" :wrapperCol="{xs: { span: 24 },sm: { span: 24 }}" label="" style="padding:20px 10px;">
                {{model.remark}}
              </a-form-item>
            </a-col>
          </a-row>
          <a-row class="form-row font-bold" :gutter="24">
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.totalAmount')">
                {{model.changeAmount}}
              </a-form-item>
            </a-col>
            <!-- <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.amountCollected')">
                {{model.changeAmount}}
              </a-form-item>
            </a-col> -->
          </a-row>
        </section>
      </template>
      <!--预收款单-->
      <template v-if="financialType === '预收款单' || financialType === '直发预收款'">
        <section ref="print" id="advanceInPrint">
          <a-row class="form-row" :gutter="24">
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.customer')">
                <a-input v-decorator="['id']" hidden/>
                {{model.organName}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.operator')">
                {{model.userName}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.documentDate')">
                {{model.billTimeStr}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.documentNo')">
                {{model.billNo}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('purchasingManagement.associatedOrder')">
                <!-- {{model.number}} -->
                {{ model.number }}
              </a-form-item>
            </a-col>
            
            <a-col :span="6" v-if="model.taxNo">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('purchasingManagement.dutyParagraph')">
                {{ model.taxNo }}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('manuManagement.state')">
                <span v-if="model.status == '0'" color="red">{{ $t('manuManagement.notApproved') }}</span>
                <span v-if="model.status == '1'" color="green">{{ $t('manuManagement.reviewed') }}</span>
                <span v-if="model.status == '4'" color="orange">{{ $t('manuManagement.notQuotation') }}</span>
              </a-form-item>
            </a-col>
          </a-row>
          <a-table
            ref="table"
            size="middle"
            bordered
            rowKey="id"
            :pagination="false"
            v-getColumnsName="'advanceInColumns'"
            :columns="advanceInColumns"
            :dataSource="dataSource">
          </a-table>
          <a-row v-if="model.remark" class="form-row" :gutter="24">
            <a-col :lg="24" :md="24" :sm="24">
              <a-form-item :labelCol="labelCol" :wrapperCol="{xs: { span: 24 },sm: { span: 24 }}" label="" style="padding:20px 10px;">
                {{model.remark}}
              </a-form-item>
            </a-col>
          </a-row>
          <a-row class="form-row font-bold" :gutter="24">
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.totalAmount')">
                {{model.totalPrice}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.amountCollected')">
                {{model.custom9}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.actualCollection')">
                {{model.changeAmount}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('popup.giveChange')">
                {{model.custom8}}
              </a-form-item>
            </a-col>
          </a-row>
        </section>
      </template>
      <!-- 提前收款 -->
      <template v-if="financialType === '预收款'">
        <section ref="print" id="directAdvanceInPrint">
          <a-row class="form-row" :gutter="24">
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.customer')">
                <a-input v-decorator="['id']" hidden/>
                {{model.organName}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.operator')">
                {{model.userName}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.documentDate')">
                {{model.billTimeStr}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.documentNo')">
                {{model.billNo}}
              </a-form-item>
            </a-col>
            <!-- <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('purchasingManagement.associatedOrder')">
                {{ model.number }}
              </a-form-item>
            </a-col> -->
            
            
          </a-row>
          <a-row v-if="model.remark" class="form-row" :gutter="24">
            <a-col :lg="24" :md="24" :sm="24">
              <a-form-item :labelCol="labelCol" :wrapperCol="{xs: { span: 24 },sm: { span: 24 }}" label="" style="padding:20px 10px;">
                {{model.remark}}
              </a-form-item>
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <!-- <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.totalAmount')">
                {{model.totalPrice}}
              </a-form-item>
            </a-col> -->
            <a-col :span="6" v-if="model.taxNo">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('purchasingManagement.dutyParagraph')">
                {{ model.taxNo }}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.amountCollected')">
                {{model.changeAmount}}
              </a-form-item>
            </a-col>
          </a-row>
        </section>
      </template>

      <!-- 提前付款 -->
      <template v-if="financialType === '预付款'">
        <section ref="print" id="directAdvanceOutPrint">
          <a-row class="form-row" :gutter="24">
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.customer')">
                <a-input v-decorator="['id']" hidden/>
                {{model.organName}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.operator')">
                {{model.userName}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.documentDate')">
                {{model.billTimeStr}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.documentNo')">
                {{model.billNo}}
              </a-form-item>
            </a-col>
            <!-- <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('purchasingManagement.associatedOrder')">
                {{ model.number }}
              </a-form-item>
            </a-col> -->
            
            
          </a-row>
          <a-row v-if="model.remark" class="form-row" :gutter="24">
            <a-col :lg="24" :md="24" :sm="24">
              <a-form-item :labelCol="labelCol" :wrapperCol="{xs: { span: 24 },sm: { span: 24 }}" label="" style="padding:20px 10px;">
                {{model.remark}}
              </a-form-item>
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <!-- <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.totalAmount')">
                {{model.totalPrice}}
              </a-form-item>
            </a-col> -->
            <a-col :span="6" v-if="model.taxNo">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('purchasingManagement.dutyParagraph')">
                {{ model.taxNo }}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('setailManagement.amountPayment')">
                {{model.changeAmount}}
              </a-form-item>
            </a-col>
          </a-row>
        </section>
      </template>
      
      <!-- 返利报表详情 -->
      <template v-if="financialType === '返利收款'">
        <section ref="print" id="rebateReceivePrint">
          <a-row class="form-row" :gutter="24">
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.customer')">
                <a-input v-decorator="['id']" hidden/>
                {{model.organName}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.operator')">
                {{model.userName}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.documentDate')">
                {{model.billTimeStr}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.documentNo')">
                {{model.billNo}}
              </a-form-item>
            </a-col>
            <!-- <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('purchasingManagement.associatedOrder')">
                {{ model.number }}
              </a-form-item>
            </a-col> -->
            
            
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('manuManagement.amountOfMoney')">
                {{model.changeAmount}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('manuManagement.rebateTotalAmount')">
                {{model.changeAmount}}
              </a-form-item>
            </a-col>
            
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('manuManagement.state')">
                <span v-if="model.status == '0'" color="red">{{ $t('manuManagement.notApproved') }}</span>
                <span v-if="model.status == '1'" color="green">{{ $t('manuManagement.reviewed') }}</span>
                <span v-if="model.status == '4'" color="orange">{{ $t('manuManagement.notQuotation') }}</span>
              </a-form-item>
            </a-col>
            
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('setailManagement.notesToDocuments')">
                {{model.remark}}
              </a-form-item>
            </a-col>
          </a-row>
        </section>
      </template>
      <!--预付款-->
      <template v-if="financialType === '直发预付款' || financialType === '直发预付' || financialType === '预付款单'">
        <section ref="print" id="advanceOutPrint">
          <a-row class="form-row" :gutter="24">
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.payingMember')">
                <a-input v-decorator="['id']" hidden/>
                {{model.organName}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('defaultTranslate.operator')">
                {{model.userName}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.documentDate')">
                {{model.billTimeStr}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.documentNo')">
                {{model.billNo}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('salesManagement.associatedOrder')">
                {{ model.number }}
              </a-form-item>
            </a-col>
            <a-col :span="6" v-if="model.taxNo">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('purchasingManagement.dutyParagraph')">
                {{ model.taxNo }}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('manuManagement.state')">
                <span v-if="model.status == '0'" color="red">{{ $t('manuManagement.notApproved') }}</span>
                <span v-if="model.status == '1'" color="green">{{ $t('manuManagement.reviewed') }}</span>
                <span v-if="model.status == '4'" color="orange">{{ $t('manuManagement.notQuotation') }}</span>
              </a-form-item>
            </a-col>
          </a-row>
          <a-table
            ref="table"
            size="middle"
            bordered
            rowKey="id"
            :pagination="false"
            v-getColumnsName="'advanceInColumns'"
            :columns="advanceInColumns"
            :dataSource="dataSource">
          </a-table>
          <a-row v-if="model.remark" class="form-row" :gutter="24">
            <a-col :lg="24" :md="24" :sm="24">
              <a-form-item :labelCol="labelCol" :wrapperCol="{xs: { span: 24 },sm: { span: 24 }}" label="" style="padding:20px 10px;">
                {{model.remark}}
              </a-form-item>
            </a-col>
          </a-row>
          <a-row class="form-row font-bold" :gutter="24">
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.totalAmount')">
                {{model.totalPrice}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.amountCollected')">
                {{model.changeAmount}}
              </a-form-item>
            </a-col>
          </a-row>
        </section>
      </template>
      
      <!--每日对账-->
      <template v-if="financialType === '每日对账'">
        <section ref="print" id="daily_reconciliation">
          <a-row class="form-row" :gutter="24">
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.documentDate')">
                {{model.operTime}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.documentNo')">
                {{model.number}}
              </a-form-item>
            </a-col>
            
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('defaultTranslate.operator')">
                {{model.userName}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('manuManagement.state')">
                <span v-if="model.status == '0'" color="red">{{ $t('manuManagement.notApproved') }}</span>
                <span v-if="model.status == '1'" color="green">{{ $t('manuManagement.reviewed') }}</span>
                <span v-if="model.status == '4'" color="orange">{{ $t('manuManagement.notQuotation') }}</span>
              </a-form-item>
            </a-col>
          </a-row>
          <a-table
            ref="table"
            size="middle"
            bordered
            rowKey="id"
            :pagination="false"
            v-getColumnsName="'dailyReconciliationColumns'"
            :columns="dailyReconciliationColumns"
            :scroll="{x:1640}"
            :dataSource="dataSource">
          </a-table>
          <a-table
            ref="tableChild"
            size="middle"
            bordered
            rowKey="id"
            :pagination="false"
            style="margin-top: 20px; width: 300px;"
            v-getColumnsName="'dailyChildColumns'"
            :columns="dailyChildColumns"
            :dataSource="childDataSource">
          </a-table>
          <a-row v-if="model.remark" class="form-row" :gutter="24">
            <a-col :lg="24" :md="24" :sm="24">
              <a-form-item :labelCol="labelCol" :wrapperCol="{xs: { span: 24 },sm: { span: 24 }}" label="" style="padding:20px 10px;">
                {{model.remark}}
              </a-form-item>
            </a-col>
          </a-row>
          <a-row class="form-row font-bold" :gutter="24" >
          <a-col :lg="6" :md="12" :sm="24">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.checkIncome')">
              {{model.invoiceTotal}}
            </a-form-item>
          </a-col>
          <a-col :lg="6" :md="12" :sm="24">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.cashIncome')">
              {{model.cashTotal}}
            </a-form-item>
          </a-col>
          <a-col :lg="6" :md="12" :sm="24">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('otherJS.bank')">
              {{ model.bankTotal }}
            </a-form-item>
          </a-col>
          <!-- 10000 -->
          <a-col :lg="6" :md="12" :sm="24">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.boxAmount')">
              {{ model.retainedAmount }}
            </a-form-item>
          </a-col>
          <a-col :lg="6" :md="12" :sm="24">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.deductAmount')">
              {{ model.deductAmountTotal }}
            </a-form-item>
          </a-col>
        </a-row>
        </section>
      </template>
      <!--转账-->
      <template v-if="financialType === '转账'">
        <section ref="print" id="giroPrint">
          <a-row class="form-row" :gutter="24">
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.financialStaff')">
                <a-input v-decorator="['id']" hidden/>
                {{model.handsPersonName}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.documentDate')">
                {{model.billTimeStr}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.documentNo')">
                {{model.billNo}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('manuManagement.state')">
                <span v-if="model.status == '0'" color="red">{{ $t('manuManagement.notApproved') }}</span>
                <span v-if="model.status == '1'" color="green">{{ $t('manuManagement.reviewed') }}</span>
                <span v-if="model.status == '4'" color="orange">{{ $t('manuManagement.notQuotation') }}</span>
              </a-form-item>
            </a-col>
            <a-col :span="6"></a-col>
          </a-row>
          <a-table
            ref="table"
            size="middle"
            bordered
            rowKey="id"
            :pagination="false"
            v-getColumnsName="'giroColumns'"
            :columns="giroColumns"
            :dataSource="dataSource">
          </a-table>
          <a-row v-if="model.remark" class="form-row" :gutter="24">
            <a-col :lg="24" :md="24" :sm="24">
              <a-form-item :labelCol="labelCol" :wrapperCol="{xs: { span: 24 },sm: { span: 24 }}" label="" style="padding:20px 10px;">
                {{model.remark}}
              </a-form-item>
            </a-col>
          </a-row>
          <a-row class="form-row font-bold" :gutter="24">
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.paymentAccount')">
                {{model.accountName}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.paidInAmount')">
                {{model.changeAmount}}
              </a-form-item>
            </a-col>
            <a-col :span="6"></a-col>
            <a-col :span="6"></a-col>
          </a-row>
        </section>
      </template>
      <!--收入-->
      <template v-if="financialType === '收入'">
        <section ref="print" id="itemInPrint">
          <a-row class="form-row" :gutter="24">
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.customer')">
                <a-input v-decorator="['id']" hidden/>
                {{model.organName}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('manuManagement.operator')">
                {{model.userName}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.documentDate')">
                {{model.billTimeStr}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.documentNo')">
                {{model.billNo}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('manuManagement.state')">
                <span v-if="model.status == '0'" color="red">{{ $t('manuManagement.notApproved') }}</span>
                <span v-if="model.status == '1'" color="green">{{ $t('manuManagement.reviewed') }}</span>
                <span v-if="model.status == '4'" color="orange">{{ $t('manuManagement.notQuotation') }}</span>
              </a-form-item>
            </a-col>
          </a-row>
          <a-row v-if="model.remark" class="form-row" :gutter="24">
            <a-col :lg="24" :md="24" :sm="24">
              <a-form-item :labelCol="labelCol" :wrapperCol="{xs: { span: 24 },sm: { span: 24 }}" label="" style="padding:20px 10px;">
                {{model.remark}}
              </a-form-item>
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.incomeAccount')">
                {{model.accountName}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.revenueAmount')">
                {{model.changeAmount}}
              </a-form-item>
            </a-col>
            <a-col :span="6"></a-col>
            <a-col :span="6"></a-col>
          </a-row>
        </section>
      </template>
      <!--支出-->
      <template v-if="financialType === $t('financialManagement.expenditure')">
        <section ref="print" id="itemOutPrint">
          <a-row class="form-row" :gutter="24">
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('manuManagement.supplier')">
                <a-input v-decorator="['id']" hidden/>
                {{model.organName}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('manuManagement.operator')">
                {{model.userName}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.documentDate')">
                {{model.billTimeStr}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.documentNo')">
                {{model.billNo}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('manuManagement.state')">
                <span v-if="model.status == '0'" color="red">{{ $t('manuManagement.notApproved') }}</span>
                <span v-if="model.status == '1'" color="green">{{ $t('manuManagement.reviewed') }}</span>
                <span v-if="model.status == '4'" color="orange">{{ $t('manuManagement.notQuotation') }}</span>
              </a-form-item>
            </a-col>
          </a-row>
          <a-row v-if="model.remark" class="form-row" :gutter="24">
            <a-col :lg="24" :md="24" :sm="24">
              <a-form-item :labelCol="labelCol" :wrapperCol="{xs: { span: 24 },sm: { span: 24 }}" label="" style="padding:20px 10px;">
                {{model.remark}}
              </a-form-item>
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.expenditureAccount')">
                {{model.accountName}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.expenditureAmount')">
                {{model.changeAmount}}
              </a-form-item>
            </a-col>
            <a-col :span="6"></a-col>
            <a-col :span="6"></a-col>
          </a-row>
        </section>
      </template>
      <!--收款-->
      <template v-if="financialType ==='收款'">
        <section ref="print" id="moneyInPrint">
          <a-row class="form-row" :gutter="24">
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.customer')">
                <a-input v-decorator="['id']" hidden/>
                {{model.organName}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.financialStaff')">
                {{model.userName}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.documentDate')">
                {{model.billTimeStr}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.documentNo')">
                {{model.billNo}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('manuManagement.state')">
                <span v-if="model.status == '0'" color="red">{{ $t('manuManagement.notApproved') }}</span>
                <span v-if="model.status == '1'" color="green">{{ $t('manuManagement.reviewed') }}</span>
                <span v-if="model.status == '4'" color="orange">{{ $t('manuManagement.notQuotation') }}</span>
              </a-form-item>
            </a-col>
            <a-col :lg="18" :md="18" :sm="18" v-if="model.custom2">
              <a-form-item :labelCol="{xs: {span: 24}, lg: {span: 2}}" :wrapperCol="{xs: {span: 24}, lg: {span: 22}}" :label="$t('manuManagement.depositReceiptNumber')">
               {{model.custom2}}
              </a-form-item>
            </a-col>
          </a-row>
          <a-table
            ref="table"
            size="middle"
            bordered
            rowKey="id"
            :pagination="false"
            v-getColumnsName="'moneyInColumns'"
            :columns="moneyInColumns"
            :dataSource="dataSource">
          </a-table>
          <a-row v-if="model.remark" class="form-row" :gutter="24">
            <a-col :lg="24" :md="24" :sm="24">
              <a-form-item :labelCol="labelCol" :wrapperCol="{xs: { span: 24 },sm: { span: 24 }}" label="" style="padding:20px 10px;">
                {{model.remark}}
              </a-form-item>
            </a-col>
          </a-row>
          <a-row class="form-row font-bold" :gutter="24">
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.collectionAccount')">
                {{model.accountName}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.totalCollection')">
                {{model.totalPrice}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('manuManagement.deposit')">
                {{model.discountMoney}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('manuManagement.substractReceivedAmount')">
                {{model.custom10}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('inPrint.currentCollection')">
                {{model.custom9}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('popup.giveChange')">
                {{model.custom8}}
              </a-form-item>
            </a-col>
          </a-row>
        </section>
      </template>
      <!--付款-->
      <template v-if="financialType === '直发付款' || financialType === '付款'">
        <section ref="print" id="moneyOutPrint">
          <a-row class="form-row" :gutter="24">
            
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.documentDate')">
                {{model.billTimeStr}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.documentNo')">
                {{model.billNo}}
              </a-form-item>
            </a-col>

            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('defaultTranslate.operator')">
                {{model.userName}}
              </a-form-item>
            </a-col>
            
            <a-col :span="6" v-if="model.taxNo">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('purchasingManagement.dutyParagraph')">
                {{ model.taxNo }}
              </a-form-item>
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('manuManagement.associated')">
                {{ model.number }}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item style="white-space:nowrap" :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.supplier')">
                <a-input v-decorator="['id']" hidden/>
                {{model.organName}}
              </a-form-item>
            </a-col>
            <a-col :lg="12" :md="12" :sm="12" v-if="model.custom2">
              <a-form-item :labelCol="{xs: {span: 24}, lg: {span: 2}}" :wrapperCol="{xs: {span: 24}, lg: {span: 22}}" :label="$t('manuManagement.depositReceiptNumber')">
               {{model.custom2}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('manuManagement.state')">
                <span v-if="model.status == '0'" color="red">{{ $t('manuManagement.notApproved') }}</span>
                <span v-if="model.status == '1'" color="green">{{ $t('manuManagement.reviewed') }}</span>
                <span v-if="model.status == '4'" color="orange">{{ $t('manuManagement.notQuotation') }}</span>
              </a-form-item>
            </a-col>
          </a-row>
          <a-table
            ref="table"
            size="middle"
            bordered
            rowKey="id"
            :pagination="false"
            v-getColumnsName="'moneyOutColumns'"
            :columns="moneyOutColumns"
            :dataSource="dataSource">
          </a-table>
          <a-row v-if="model.remark" class="form-row" :gutter="24">
            <a-col :lg="24" :md="24" :sm="24">
              <a-form-item :labelCol="labelCol" :wrapperCol="{xs: { span: 24 },sm: { span: 24 }}" label="" style="padding:20px 10px;">
                {{model.remark}}
              </a-form-item>
            </a-col>
          </a-row>
          <a-row class="form-row font-bold" :gutter="24">
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.paymentAccount')">
                {{model.accountName}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.totalPayment')">
                {{model.totalPrice}}
              </a-form-item>
            </a-col>
            <!-- <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.preferentialAmount')">
                {{model.discountMoney}}
              </a-form-item>
            </a-col> -->
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('manuManagement.substractAmount')">
                {{model.custom10}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.actualPayment')">
                {{model.changeAmount}}
              </a-form-item>
            </a-col>
          </a-row>
        </section>
      </template>
      <!-- 直发收款 -->
      <template v-if="financialType === '直发收款'">
        <section ref="print" id="FactoryMoneyIn">
          <a-row class="form-row" :gutter="24">
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.documentDate')">
                {{model.billTimeStr}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.documentNo')">
                {{model.billNo}}
              </a-form-item>
            </a-col>

            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('defaultTranslate.operator')">
                {{model.userName}}
              </a-form-item>
            </a-col>
             <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('manuManagement.associated')">
                {{ model.number }}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item style="white-space:nowrap" :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.customer')">
                <a-input v-decorator="['id']" hidden/>
                {{model.organName}}
              </a-form-item>
            </a-col>
            
            <a-col :span="6" v-if="model.taxNo">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('purchasingManagement.dutyParagraph')">
                {{ model.taxNo }}
              </a-form-item>
            </a-col>
            <a-col :span="6" v-if="model.custom2">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('manuManagement.depositReceiptNumber')">
                {{ model.custom2 }}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('manuManagement.state')">
                <span v-if="model.status == '0'" color="red">{{ $t('manuManagement.notApproved') }}</span>
                <span v-if="model.status == '1'" color="green">{{ $t('manuManagement.reviewed') }}</span>
                <span v-if="model.status == '4'" color="orange">{{ $t('manuManagement.notQuotation') }}</span>
              </a-form-item>
            </a-col>
          </a-row>
          <a-table
            ref="table"
            size="middle"
            bordered
            rowKey="id"
            :pagination="false"
            v-getColumnsName="'FactoryMoneyInColumns'"
            :columns="FactoryMoneyInColumns"
            :dataSource="dataSource">
          </a-table>
          <a-row v-if="model.remark" class="form-row" :gutter="24">
            <a-col :lg="24" :md="24" :sm="24">
              <a-form-item :labelCol="labelCol" :wrapperCol="{xs: { span: 24 },sm: { span: 24 }}" label="" style="padding:20px 10px;">
                {{model.remark}}
              </a-form-item>
            </a-col>
          </a-row>
          <a-row class="form-row font-bold" :gutter="24">
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.collectionAccount')">
                {{model.accountName}}
              </a-form-item>
            </a-col>
            <a-col :span="6" v-if="model.taxInvoiceNo">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.checkNumber')">
                {{model.taxInvoiceNo}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.totalCollection')">
                {{model.totalPrice}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('manuManagement.deposit')">
                {{model.discountMoney}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('manuManagement.substractReceivedAmount')">
                {{model.custom10}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.actualCollection')">
                {{model.changeAmount}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.amountCollected')">
                {{model.custom9}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('setailManagement.giveChange')">
                {{model.custom8}}
              </a-form-item>
            </a-col>
          </a-row>
        </section>
      </template>
      <!-- 运费单 直发运费单-->
      <template v-if="financialType === '运费单' || financialType === '运费' || financialType === '直发运费单' || financialType === '直发运费'">
        <section ref="print" id="freightBillPrint">
          <a-row class="form-row" :gutter="24">
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.supplier')">
                <a-input v-decorator="['id']" hidden/>
                {{model.organName}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.documentDate')">
                {{model.billTimeStr}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.documentNo')">
                {{model.billNo}}
              </a-form-item>
            </a-col>
            <!-- ---------- -->
            
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('manuManagement.associated')">
                {{ model.number }}
              
              </a-form-item>
            </a-col>
            <a-col :span="6" v-if="model.taxNo">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('purchasingManagement.dutyParagraph')">
                {{ model.taxNo }}
              </a-form-item>
            </a-col>
            <!-- <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('purchasingManagement.acceptanceWarehouse')">
                {{model.billNo}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('defaultTranslate.operator')">
                {{model.billNo}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('purchasingManagement.dutyParagraph')">
                {{model.billNo}}
              </a-form-item>
            </a-col> -->
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('manuManagement.state')">
                <span v-if="model.status == '0'" color="red">{{ $t('manuManagement.notApproved') }}</span>
                <span v-if="model.status == '1'" color="green">{{ $t('manuManagement.reviewed') }}</span>
                <span v-if="model.status == '4'" color="orange">{{ $t('manuManagement.notQuotation') }}</span>
              </a-form-item>
            </a-col>
          </a-row>
          <a-table
            ref="table"
            size="middle"
            bordered
            rowKey="id"
            :pagination="false"
            v-getColumnsName="'freightBillColumns'"
            :columns="freightBillColumns"
            :dataSource="dataSource">
          </a-table>
          <a-row class="form-row" :gutter="24">
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.totalAmount')">
                {{model.totalPrice}}
              </a-form-item>
            </a-col>
          </a-row>
          <a-row class="form-row" style="margin-left: -12px; margin-right: -12px;">
            <a-col :span="24">
              <a-form-item :labelCol="{xs: { span: 3},sm: { span: 2 }}" :wrapperCol="wrapperCol" :label="$t('reportQuery.remarks')" >
                {{model.remark}}
              </a-form-item>
            </a-col>
          </a-row>
          <a-row class="form-row" :gutter="24">
            <!-- <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.paymentAccount')">
                {{model.accountName}}
              </a-form-item>
            </a-col> -->
          
            <!-- <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.preferentialAmount')">
                {{model.discountMoney}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('financialManagement.actualPayment')">
                {{model.changeAmount}}
              </a-form-item>
            </a-col> -->
          </a-row>
        </section>
      </template>
      <!--运输单明细-->
      <template v-if="financialType === this.$t('reportQuery.transportionDocumentNoDetail')">
        <section ref="print" id="freightBillPrintDetail">
          <a-row class="form-row" :gutter="24">
            <a-col :span="8">
              <a-form-item :labelCol="labelStyle" :wrapperCol="wrapperStyle" :label="$t('reportQuery.supplier')">
                <a-input v-decorator="['id']" hidden/>
                {{model.organName}}
              </a-form-item>
            </a-col>
            <a-col :span="8">
              <a-form-item :labelCol="labelStyle" :wrapperCol="wrapperStyle" :label="$t('reportQuery.documentDate')">
                {{model.billTimeStr}}
              </a-form-item>
            </a-col>
            <a-col :span="8">
              <a-form-item :labelCol="labelStyle" :wrapperCol="wrapperStyle" :label="$t('reportQuery.documentNo')">
                {{model.billNo}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('manuManagement.state')">
                <span v-if="model.status == '0'" color="red">{{ $t('manuManagement.notApproved') }}</span>
                <span v-if="model.status == '1'" color="green">{{ $t('manuManagement.reviewed') }}</span>
                <span v-if="model.status == '4'" color="orange">{{ $t('manuManagement.notQuotation') }}</span>
              </a-form-item>
            </a-col>
          </a-row>
          <a-table
            ref="table"
            size="middle"
            bordered
            rowKey="id"
            :pagination="false"
            v-getColumnsName="'tranportNumberColunms'"
            :columns="tranportNumberColunms"
            :dataSource="dataSource">
            <template slot="isExchange" slot-scope="type, record">
              {{record.paymentType == 1 ? '-' : (record.isExchange == 1 ? $t('reportQuery.paid'): $t('reportQuery.unpaid'))}}
            </template>
            <template slot="paymentType" slot-scope="type, record">
              {{record.paymentType == 1 ? $t('reportQuery.yes') : $t('reportQuery.no')}}
            </template>
          </a-table>
          <a-row class="form-row" :gutter="24">
            <a-col :lg="24" :md="24" :sm="24">
              <a-form-item :labelCol="labelCol" :wrapperCol="{xs: { span: 24 },sm: { span: 24 }}" label="" style="padding:20px 10px;">
                {{model.remark ? `${$t('financialManagement.remarks')}: ${model.remark}`: ''}}
              </a-form-item>
            </a-col>
          </a-row>
          <a-row class="form-row font-bold" :gutter="24">
            <a-col :span="8">
              <a-form-item :labelCol="labelStyle" :wrapperCol="wrapperStyle" :label="$t('reportQuery.totalPrice')">
                {{model.totalPrice}}
              </a-form-item>
            </a-col>
          </a-row>
        </section>
      </template>

      <!-- 运输付款 -->
      <template v-if="financialType === '运输付款' || financialType === '直发运输付款' || financialType === '运输付款'">
        <section ref="print" id="freightPaymentPrint">
          <a-row class="form-row" :gutter="24">
            <a-col :span="6">
              <a-form-item :labelCol="labelStyle" :wrapperCol="wrapperStyle" :label="$t('purchasingManagement.TransportCompany')">
                <a-input v-decorator="['id']" hidden/>
                {{model.tanspotName}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelStyle" :wrapperCol="wrapperStyle" :label="$t('purchasingManagement.operator')">
                {{model.userName}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelStyle" :wrapperCol="wrapperStyle" :label="$t('purchasingManagement.documentDate')">
                {{model.billTimeStr}}
              </a-form-item>
            </a-col>
            <a-col :span="6" v-if="model.taxNo">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('purchasingManagement.dutyParagraph')">
                {{ model.taxNo }}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('manuManagement.state')">
                <span v-if="model.status == '0'" color="red">{{ $t('manuManagement.notApproved') }}</span>
                <span v-if="model.status == '1'" color="green">{{ $t('manuManagement.reviewed') }}</span>
                <span v-if="model.status == '4'" color="orange">{{ $t('manuManagement.notQuotation') }}</span>
              </a-form-item>
            </a-col>
          </a-row>
          <a-table
            ref="table"
            size="middle"
            bordered
            rowKey="id"
            :pagination="false"
            v-getColumnsName="'freightPaymentColunms'"
            :columns="freightPaymentColunms"
            :dataSource="[model]">
          </a-table>
          <!-- <a-row v-if="model.remark" class="form-row" :gutter="24">
            <a-col :lg="24" :md="24" :sm="24">
              <a-form-item :labelCol="labelCol" :wrapperCol="{xs: { span: 24 },sm: { span: 24 }}" label="" style="padding:20px 10px;">
                {{model.remark}}
              </a-form-item>
            </a-col>
          </a-row> -->
          <a-row class="form-row font-bold" :gutter="24">
            <a-col :span="6">
              <a-form-item :labelCol="labelStyle" :wrapperCol="wrapperStyle" :label="$t('financialManagement.expenditureAccount')">
                {{model.accountName}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelStyle" :wrapperCol="wrapperStyle" :label="$t('financialManagement.expenditureAmount')">
                {{model.changeAmount}}
              </a-form-item>
            </a-col>
            <a-col :span="6">
              <a-form-item :labelCol="labelStyle" :wrapperCol="wrapperStyle" :label="$t('financialManagement.preferentialAmount')">
                {{model.discountMoney}}
              </a-form-item>
            </a-col>
          </a-row>
        </section>
      </template>

      <template >
        <a-row class="form-row" :gutter="24">
          <a-col :span="8">
            <a-form-item  :labelCol="{xs: { span: 24 },sm: { span: 8 }}" :wrapperCol="{xs: { span: 24 },sm: { span: 16 }}" :label="$t('inPrint.enclosure')">
              <div v-if="fileLoading">Loading...</div>
              <j-upload v-else :fileList="fileList" bizPath="bill" :disabled="true" :buttonVisible="false"></j-upload>
            </a-form-item>
          </a-col>
        </a-row>
      </template>
    </a-form> 
  </j-modal>
</template>
<script>
import pick from 'lodash.pick'
import { getAction } from '@/api/manage'
import JsBarcode from 'jsbarcode'
import { 
  findBillDetailByNumber,
  getCurrentSystemConfig,
  getProgressByDefaultNumber,
  findBySubType,
} from '@/api/api'
import JUpload from '@/components/jeecg/JUpload'
import { getLanCode,isChina } from '@/lang'
import {category,titleObj} from '@/lang/category';
import erplogo from '@/assets/login/erp-logo.jpg'
import Vue from "vue"
  export default {
    name: 'FinancialDetail',
    components: {
      JUpload
    },
    data () {
      return {
        title: this.$t('reportQuery.details'),
        width: '1600px',
        visible: false,
        model: {},
        financialType: '',
        fileList: [],
        fileLoading:false,
        labelCol: {
          xs: { span: 24 },
          sm: { span: 8 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        labelStyle: {
          xs: { span: 24 },sm: { span: 8 }
        },
        wrapperStyle: {
          xs: { span: 24 },sm: { span: 16 }
        },
        form: this.$form.createForm(this),
        loading: false,
        dataSource: [],
        childDataSource:[],
        printDirectiveData:{},
        getElId:()=>this.getElIdFunc(),
        url: {
          detailList: '/accountItem/getDetailList'
        },
        columnsName: '',
        advanceInColumns: [
        { title: this.$t('defaultTranslate.lineNumber'), dataIndex: 'rowIndex', width: '4%', align:"center",customRender: (t,r,index)=>t || (parseInt(index) + 1)},
          { title: this.$t('popup.titleOfAccount'),dataIndex: 'accountName',width: '30%'},
          { title: this.$t('reportQuery.amount'),dataIndex: 'eachAmount', width: '30%'},
          { title: this.$t('reportQuery.remarks'),dataIndex: 'remark', width: '30%'}
        ],
        dailyChildColumns:[
        { title: this.$t('financialManagement.lessee'),dataIndex: 'loginName', width: '8%'},
          
          { title: 'S/Total',dataIndex: 'totalAmount', width: '8%'},
        ],
        dailyReconciliationColumns: [
          { title: this.$t('financialManagement.lessee'), dataIndex: 'loginName',  width: '10%'},
          { title: this.$t('financialManagement.device'), dataIndex: 'device',  width: '8%'},
          { title: this.$t('financialManagement.cashAmount'), dataIndex: 'cashAmount',  width: '8%'},
          { title: 'KINA EFS/' +this.$t('otherJS.bank'), dataIndex: 'bankAmount',  width: '8%'},
          { title: `CHQ(${this.$t('financialManagement.CHQ')})`, dataIndex: 'invoiceAmount',  width: '8%'},
          { title: 'OTHERS', dataIndex: 'specialAmount',  width: '8%'},
          { title: this.$t('financialManagement.presenterMoney'), dataIndex: 'giftAmount',  width: '8%'},
          { title: this.$t('financialManagement.discountWhenSpendingEnough'), dataIndex: 'discountAmount',  width: '8%'},
          { title: this.$t('financialManagement.breakageAmount'), dataIndex: 'breakageAmount',  width: '8%'},
          { title: 'G/TOTAL', dataIndex: 'subTotal',  width: '8%'},
          { title: 'Reading', dataIndex: 'readingTotal',  width: '8%'},
          { title: 'g.ttl', dataIndex: 'ttl',  width: '8%'},
          { title: this.$t('financialManagement.boxAmount'), dataIndex: 'boxAmount',  width: '8%'},
          { title: this.$t('financialManagement.deductAmount'), dataIndex: 'deductAmount',  width: '8%'},
          { title: this.$t('financialManagement.differenceAmount'), dataIndex: 'difference',  width: '8%'},

        ],
        checkVerificationColumns: [
        { title: this.$t('defaultTranslate.lineNumber'), dataIndex: 'rowIndex', width: '8%', align:"center",customRender: (t,r,index)=>t || (parseInt(index) + 1)},
          { title: this.$t('popup.titleOfAccount'),dataIndex: 'accountName',width: '10%'},
          { title:this.$t('financialManagement.checkNumber'), dataIndex: 'invoiceNo',width:'14%'},
          { title: this.$t('reportQuery.amount'),dataIndex: 'eachAmount', width: '10%'},
          { title:this.$t('financialManagement.checkAmount'), dataIndex: 'needDebt',width:80},
          { title:this.$t('financialManagement.notVerifiedAmount'), dataIndex: 'notVerifiedAmount',width:100, 
            // customRender:record => (record.eachAmount*100 - record.finishDebt*100) / 100
          },
          { title:this.$t('financialManagement.verifiedAmount'), dataIndex: 'finishDebt',width:100},
          { title: this.$t('reportQuery.remarks'),dataIndex: 'remark', width: '10%'}
        ],
        giroColumns: [
        { title: this.$t('defaultTranslate.lineNumber'), dataIndex: 'rowIndex', width: '4%', align:"center",customRender: (t,r,index)=>t || (parseInt(index) + 1)},
          { title: this.$t('popup.titleOfAccount'),dataIndex: 'accountName',width: '30%'},
          { title: this.$t('reportQuery.amount'),dataIndex: 'eachAmount', width: '30%'},
          { title: this.$t('reportQuery.remarks'),dataIndex: 'remark', width: '30%'}
        ],
        itemInColumns: [
        { title: this.$t('defaultTranslate.lineNumber'), dataIndex: 'rowIndex', width: '4%', align:"center",customRender: (t,r,index)=>t || (parseInt(index) + 1)},
          { title: this.$t('popup.revenueItems'),dataIndex: 'inOutItemName',width: '30%'},
          { title: this.$t('reportQuery.amount'),dataIndex: 'eachAmount', width: '30%'},
          { title: this.$t('reportQuery.remarks'),dataIndex: 'remark', width: '30%'}
        ],
        itemOutColumns: [
        { title: this.$t('defaultTranslate.lineNumber'), dataIndex: 'rowIndex', width: '4%', align:"center",customRender: (t,r,index)=>t || (parseInt(index) + 1)},
          { title: this.$t('popup.expenditureItems'),dataIndex: 'inOutItemName',width: '30%'},
          { title: this.$t('reportQuery.amount'),dataIndex: 'eachAmount', width: '30%'},
          { title: this.$t('reportQuery.remarks'),dataIndex: 'remark', width: '30%'}
        ],
        moneyInColumns: [
        { title: this.$t('defaultTranslate.lineNumber'), dataIndex: 'rowIndex', width: '4%', align:"center",customRender: (t,r,index)=>t || (parseInt(index) + 1)},
          {
            title: this.$t('popup.salesDocumentNo'), dataIndex: 'billNumber', width: '20%'
          },
          { title: this.$t('popup.arrearsReceivable'),dataIndex: 'needDebt', width: '10%'},
          { title: this.$t('inPrint.arrearsReceived'),dataIndex: 'finishDebt', width: '10%'},
          { title: this.$t('inPrint.currentCollection'),dataIndex: 'eachAmount', width: '10%'},
          { title: this.$t('reportQuery.remarks'),dataIndex: 'remark', width: '20%'}
        ],
        moneyOutColumns: [
        { title: this.$t('defaultTranslate.lineNumber'), dataIndex: 'rowIndex', width: '4%', align:"center",customRender: (t,r,index)=>t || (parseInt(index) + 1)},
          { title: this.$t('otherJS.receiptdate'), dataIndex: 'operTimeStr', width: '10%',  },
          {
            title: this.$t('setailManagement.warehouseName'), dataIndex: 'depotName', width: '7%'
          },
          { title: this.$t('purchasingManagement.invoicedate'), dataIndex: 'exchangeTime', width: '8%'},
          {
            title: this.$t('purchasingManagement.invoicenumber'), dataIndex: 'invoiceNo', width: '8%'},
          { title: this.$t('purchasingManagement.invoicevalue'), dataIndex: 'needDebt', width: '8%'},
          { title: this.$t('purchasingManagement.discountamount'), dataIndex: 'discountAmount' },
          { title: this.$t('purchasingManagement.Totalbankamount'), dataIndex: 'eachAmount' },
         
        ],
        FactoryMoneyInColumns: [
        { title: this.$t('defaultTranslate.lineNumber'), dataIndex: 'rowIndex', width: '4%', align:"center",customRender: (t,r,index)=>t || (parseInt(index) + 1)},
          { title: this.$t('otherJS.receiptdate'), dataIndex: 'operTimeStr', width: '10%',  },
          // {
          //   title: this.$t('setailManagement.warehouseName'), dataIndex: 'depotName', width: '7%'
          // },
          // { title: this.$t('purchasingManagement.invoicedate'), dataIndex: 'exchangeTime', width: '8%'},
          // {
          //   title: this.$t('purchasingManagement.invoicenumber'), dataIndex: 'invoiceNo', width: '8%'},
          { title: this.$t('purchasingManagement.invoicevalue'), dataIndex: 'needDebt', width: '8%'},
          { title: this.$t('purchasingManagement.discountamount'), dataIndex: 'discountAmount' },
          { title: this.$t('purchasingManagement.Totalbankamount'), dataIndex: 'eachAmount' },
         
        ],
        freightBillColumns: [
        { title: this.$t('defaultTranslate.lineNumber'), dataIndex: 'rowIndex', width:'4%', align:"center",customRender: (t,r,index)=>t || (parseInt(index) + 1)},
          { title: this.$t('purchasingManagement.TransportCompany'),dataIndex: 'transpotName', width: '7%'},
          { title: this.$t('purchasingManagement.size'),dataIndex: 'packsOrdered', width: '7%'},
          // { title: 'GTIN',dataIndex: 'gtin', width: '7%'},
          // { title: 'UOM',dataIndex: 'uom', width: '7%'},
          // { title: this.$t('purchasingManagement.OrderedPackage'),dataIndex: 'packsOrdered', width: '7%'},
          { title: this.$t('purchasingManagement.unitPrice'),dataIndex: 'unitPrice', width: '7%'},
          { title: this.$t('purchasingManagement.amount'),dataIndex: 'amount', width: '7%'},
          { title: this.$t('purchasingManagement.discountamount'),dataIndex: 'discountAmount',  width: '7%'},
          { title: this.$t('purchasingManagement.eachAmount'),dataIndex: 'eachAmount', width: '7%',},
          { title: this.$t('purchasingManagement.IsPayByFactory'),dataIndex: 'paymentType', width: '7%',customRender:(t)=>{
            if(+t === 0){
              return this.$t('reportQuery.no')
            }else if(+t=== 1){
              return this.$t('reportQuery.yes')
            }
          } },             
        ],
        tranportNumberColunms: [
        { title: this.$t('defaultTranslate.lineNumber'), dataIndex: 'rowIndex', width: '4%', align:"center",customRender: (t,r,index)=>t || (parseInt(index) + 1)},
          { title: this.$t('purchasingManagement.TransportCompany'),dataIndex: 'transpotName', width: '7%'},
          { title: this.$t('purchasingManagement.size'),dataIndex: 'packsOrdered', width: '7%'},
          { title: this.$t('purchasingManagement.unitPrice'),dataIndex: 'unitPrice', width: '7%'},
          { title: this.$t('purchasingManagement.amount'),dataIndex: 'amount', width: '7%'},
          { title: this.$t('purchasingManagement.discountamount'),dataIndex: 'discountAmount',  width: '7%'},
          { title: this.$t('purchasingManagement.eachAmount'),dataIndex: 'eachAmount', width: '7%',},
          { title: this.$t('purchasingManagement.IsPayByFactory'),dataIndex: 'paymentType', width: '7%',
            scopedSlots: {customRender: 'paymentType'}
          },
          { title: this.$t('purchasingManagement.payStatus'),dataIndex: 'isExchange', width: '7%',
            scopedSlots: {customRender: 'isExchange'}
          },         
        ],
        freightPaymentColunms: [
        { title: this.$t('defaultTranslate.lineNumber'), dataIndex: 'rowIndex', width: '4%', align:"center",customRender: (t,r,index)=>t || (parseInt(index) + 1)},
          { title: this.$t('purchasingManagement.TransportCompany'),dataIndex: 'tanspotName', readonly: true },
          { title: this.$t('purchasingManagement.trackingNumber'),dataIndex: 'billNo', readonly: true },
          { title: this.$t('purchasingManagement.discountamount'), dataIndex: 'discountMoney', width: 200 },
          { title: this.$t('purchasingManagement.totalAmount'),dataIndex: 'changeAmount', placeholder: this.$t('inPrint.pleaseTnter') + '${title}',},
          { title: this.$t('financialManagement.remarks'), dataIndex: 'remark', width: 200 },
        ]
      }
    },
    created () {
      console.log(this.financialType,8999);
      let realScreenWidth = window.screen.width
      this.width = realScreenWidth<1500?'1300px':'1550px'
    },
    directives: {
      getColumnsName: {
        bind (el, binding, vnode) {
          vnode.context.columnsName = binding.value
        }
      }
    },
    methods: {
      show(record, type) {
      
        console.log('title :>> ', this.title);
        console.log('type :>> ', type);
        this.financialType = type
        // if (getLanCode() === 'en') {
        //   this.financialType = category[type] || type
        // }
        console.log('this.financialType :>> ', this.financialType);
        //附件下载
        
      if (getLanCode() === 'en') {
        this.$nextTick(()=>{
          if(isChina(this.title)){
          this.title = titleObj[this.title] || this.title
          this.title = this.title + ' - ' + this.$t('defaultTranslate.detail')
        }
        })
      }
        this.fileList = record.fileName
        this.visible = true;
        this.model = Object.assign({}, record);
        this.$nextTick(() => {
          this.form.setFieldsValue(pick(this.model,'id'))
          this.addLogo();
          this.addBarCode();
          this.getSystemConfig()
        });
        let params = {
          headerId: this.model.id,
        }
        let url = this.readOnly ? this.url.detailList : this.url.detailList;
        this.requestSubTableData(url, params,((res)=>{
          if(this.columnsName === 'dailyChildColumns'){
           this.countTotal(res.data.rows)
          //  this.updataForm(res.data.rows)
          }
        }));
      this.getFileList(record)
      this.findBySubType()
    },
    findBySubType(){
      findBySubType({subType:this.financialType}).then(res=>{
        if(res.code === 200){
          this.printDirectiveData ={
            flag:this.initActiveBtnStr(res.data.url,'10') && this.financialType !== '每日对账表',
            printId:this.model.id,
            printName:res.data.name,
            custom1:this.model.billNo || this.model.number,
            printType:2,//1列表，2详情
            custom11:2,//1.订单详情，2.财务订单详情
          }
        }
      })
    },
    
    /* 按钮权限 */
    initActiveBtnStr (pathName,btnValue) {
      let btnStrList = Vue.ls.get('winBtnStrList') //按钮功能列表 JSON字符串
      let btnEnableList = '' //按钮列表
      if (pathName.indexOf('/plugins') > -1) {
        pathName = '/system' + pathName
      }
      if (pathName && btnStrList) {
        for (let i = 0; i < btnStrList.length; i++) {
          if (btnStrList[i].url === pathName) {
            if (btnStrList[i].btnStr) {
              btnEnableList = btnStrList[i].btnStr
            }
          }
        }
      }
      return btnEnableList.indexOf(btnValue) > -1
    },
    
    setTitle(title){
      if(getLanCode() === 'en'){
        this.title = titleObj[title] || title
      }else{
        this.title = title
      }
      this.title += ' - '+this.$t('defaultTranslate.detail')
    }, 
    myHandleDetail(billNumber) {
      findBillDetailByNumber({ number: billNumber }).then((res) => {
        if (res && res.code === 200) {
          let detailType = res.data.subType
          let title = res.data.subType
          // 处理英文
          if (getLanCode() === 'en') {
            
            title = titleObj[res.data.subType] || res.data.subType
            detailType = category[res.data.subType] || res.data.subType
          }
          this.$refs.billDetail.show(res.data, title);
        }
      })
    },
      getFileList (record) {
        let params = {
          id: record.id
        }
        this.fileLoading = true
      getAction('/attachment/getAttachmentListById', params).then(res => {
        this.fileLoading = false
        if (res.code === 200) {
          let arr = res.data
          this.fileList = arr.map(v=>{
            return  {
              uid :v.id,
              url :v.data,
              flag :'1',
              status :'done',
              name :v.fileName,
              data:v.data
            }
          })
        }
      })
    },
      requestSubTableData(url, params, success) {
        getAction(url, params).then(res => {
          if(res && res.code === 200){
            this.dataSource = res.data.rows
            if(this.columnsName === 'checkVerificationColumns'){
              this.dataSource = this.dataSource.map(v=>{
                v.notVerifiedAmount = (v.eachAmount*100 - v.finishDebt*100) / 100
                return v
              })
            }
            typeof success === 'function' ? success(res) : ''
            this.$nextTick(() => {
              this.tableAddTotalRow(this[this.columnsName], this.dataSource)
            })
          }
        }).finally(() => {
          this.loading = false
        })
      },
      handleCancel() {
        this.close()
      },
      close() {
        this.$emit('close');
        this.visible = false;
      },
      abc () {
        console.log('abc')
      },
      tableAddTotalRow (columns, dataSource) {
        console.log('columns :>> ', columns);

      if (dataSource.length > 0) {
        let numKey = 'rowIndex'
        let totalRow = { [numKey]: getLanCode() === 'zh' ? '合计' : 'Total' }
        //需要合计的列
        let parseCols =
          'initialStock,currentStock,currentStockPrice,initialAmount,thisMonthAmount,currentAmount,inSum,inSumPrice,inOutSumPrice,' +
          'outSum,outSumPrice,outInSumPrice,operNumber,allPrice,numSum,priceSum,prevSum,thisSum,thisAllPrice,changeAmount,eachAmount,discountAmount, needDebt' +
          'allPrice,currentNumber,lowSafeStock,highSafeStock,lowCritical,highCritical,preNeed,debtMoney,backMoney,allNeed' +
          'checkAmount, totalPrice, notVerifiedAmount,finishDebt'
        columns.forEach(column => {
          let { key, dataIndex } = column
          if (![key, dataIndex].includes(numKey)) {
            let total = 0
            dataSource.forEach(data => {
              if (parseCols.indexOf(dataIndex) > -1) {
                if (data[dataIndex]) {
                  total += Number.parseFloat(data[dataIndex])
                } else {
                  total += 0
                }
              } else {
                total = '-'
              }
            })
            if (total !== '-') {
              total = total.toFixed(2)
            }
            totalRow[dataIndex] = total
          }
        })
        dataSource.push(totalRow)
      }
    },
    addLogo(){
      let logoPrint = document.querySelector('.financial-detail_v2023 section[id]')
      let imgEl = document.querySelectorAll('#erplogo')
      if(!imgEl.length){
        
        const template =  `<div style="text-align: center;font-size: 18px;font-weight: bold;">${this.title}</div>
        <div class="ant-row">
      <div class="ant-col ant-col-24">
        <img id="erplogo" src="${erplogo}" alt="" style="margin: 10px auto; width: 100px" />
      </div>
    </div>`
        let divEl = document.createElement('div')
        divEl.innerHTML = template
        logoPrint.prepend(divEl)
      }
    },
    
    // 生成一维码
    bindBarCode (selector, billNo) {
        JsBarcode(selector, billNo, {
          background: '#eee',
          displayValue: false,
          // width: 1, // 
          height: 80, // 一维码的高度
          margin: 10 // 一维码与容器的margin
        })
      },
    
    // 获取审核人列表
    getProgressByDefaultNumber(){
      return new Promise((resolve,reject)=>{
        getProgressByDefaultNumber({defaultNumber:this.model.billNo}).then(res=>{
          if(res.code == 200){
            resolve(res.data)
          }else{
            reject()
          }
        })
      })
    },
    async addBarCode(){
      let canvasNode = document.querySelectorAll('.financial-detail_v2023 canvas')
      let  progressList = await this.getProgressByDefaultNumber() || []
      let users = progressList.map(v=>v.username).join(',')
      if(this.model.billNo && !canvasNode.length){
        let barCodePrint = document.querySelector('.financial-detail_v2023 section[id]')
        const template =  `<div class="form-row ant-row" style="margin-left: -12px; margin-right: -12px; margin-top: 20px">
          <div class="ant-col ant-col-6" style="padding-left: 12px; padding-right: 12px">
            <div class="ant-row ant-form-item">
              <div class="ant-col ant-col-xs-24 ant-col-sm-8 ant-form-item-label">
                <label title="${this.$t('setailManagement.barCode')}">${this.$t('setailManagement.barCode')}</label>
              </div>
              <div class="ant-col ant-col-xs-24 ant-col-sm-16 ant-form-item-control-wrapper">
                <div class="ant-form-item-control">
                  <span class="ant-form-item-children"
                    ><canvas style="width:200px!important" id="barCode"  width="200" height="50"></canvas></span
                  >
                </div>
              </div>
            </div>
          </div>
          <div class="ant-col ant-col-6" style="padding-left: 12px; padding-right: 12px;">
            <div class="ant-row ant-form-item">
                <div class="ant-col ant-col-xs-24 ant-col-sm-8 ant-form-item-label"><label title="${this.$t('purchasingManagement.Auditor')}"
                        class="">${this.$t('purchasingManagement.Auditor')}</label></div>
                <div class="ant-col ant-col-xs-24 ant-col-sm-16 ant-form-item-control-wrapper">
                    <div class="ant-form-item-control"><span class="ant-form-item-children">${users}</span><!----></div>
                </div>
            </div>
        </div>
        </div>`
        let divEl = document.createElement('div')
        divEl.innerHTML = template
        barCodePrint.appendChild(divEl.firstChild)
        this.bindBarCode('#barCode',this.model.billNo)
      }
      
    },
    getSystemConfig() {
      getCurrentSystemConfig().then((res) => {
        // console.log("系统配置",res.data);
        if (res.code === 200 && res.data) {
          this.model.taxNo = res.data.companyFax
        }
      })
    },
    

    // 计算每日对账表
    countTotal(array){
        const arr = [...new Set(this.dataSource.map(v=>v.lessee))]
        this.childDataSource = arr.map(v=>{
            let obj = {}
            obj.totalAmount = array.filter(val=>val.lessee === v).reduce((s,c)=>{
              return s += +c.readingTotal || 0
            },0)
            obj.lessee = v
            obj.username = array.find(val=>val.lessee === v).username
            return obj
        })
        
      },
  
    }
  }
</script>

<style>

.font-bold .ant-col.ant-col-xs-24.ant-col-sm-16.ant-form-item-control-wrapper .ant-form-item-control .ant-form-item-children {
    font-weight: bold!important;
}
</style>